Page({
  data: {
    out_mch_id: my.getStorageSync({ key: 'pay_mch_key' }).data.out_mch_id,
    out_sub_mch_id: my.getStorageSync({ key: 'pay_mch_key' }).data.out_sub_mch_id,
    out_shop_id: my.getStorageSync({ key: 'pay_mch_key' }).data.out_shop_id,
    key: my.getStorageSync({ key: 'key' }).data,
    nohead: my.getStorageSync({ key: 'nohead' }).data,
    device_id: my.getStorageSync({ key: 'device_id' }).data,
    shopname: my.getStorageSync({ key: 'shopname' }).data,
  },
  onLoad() { },
  save() {
    my.setStorage({
      key: 'key',
      data: this.data.key,
    });
    my.setStorage({
      key: 'pay_mch_key',
      data: { 'pay_platform': 1, 'out_mch_id': this.data.out_mch_id, 'out_sub_mch_id': this.data.out_sub_mch_id, 'out_shop_id': this.data.out_shop_id },
    });
    my.setStorage({
      key: 'nohead',
      data: this.data.nohead,
    });
    my.setStorage({
      key: 'device_id',
      data: this.data.device_id,
    });
    my.setStorage({
      key: 'shopname',
      data: this.data.shopname,
    });
    my.showToast({
      type: 'success',
      content: '保存成功',
      duration: 3000,
    });
  },
});
